#include "renderer.h"

namespace sol9
{

	bool renderer::initialize(hdc_ptr& hdc, const dimension2du& size)
	{
		return raster.initialize(hdc, size);
	}

	void renderer::beginScene()
	{
		raster.beginScene();
	}

	void renderer::endScene()
	{
		raster.endScene();
	}

	void renderer::draw(polygon_ptr& p)
	{
		if (!p)
			return;

		vertices& v = p->v;

		u32 i;
		for (i = 0; i < v.size() - 1; ++i)
			raster.drawLine(v.at(i), v.at(i + 1));

		raster.drawLine(v.at(i), v.at(0));
	}

}